<link href="images/skin.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="js/jquery-1.4.4.min.js" type="text/javascript"></script>
<link type="text/css" rel="stylesheet" href="css/validator.css"></link>
<script src="js/formValidator.js" type="text/javascript"></script>
<script src="js/formValidatorRegex.js" type="text/javascript"></script>
<script defer="defer" src="js/WdatePicker.js" type="text/javascript"></script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #EEF2FB;
}
-->
</style>

<script type="text/javascript">
	$(document).ready(
		function(){
			$.formValidator.initConfig({formid:"myForm",onerror:function(msg){alert(msg)},onsuccess:function(){return true;}});
			$("#name").formValidator({onshow:"请输入用户名",onfocus:"请输入用户名"})
		    .ajaxValidator({
			    type : "get",
				url : "name.php?type=name",
				datatype : "json",
				success : function(data){	
		            if( data == "1" )
					{
		                return true;
					}
		            else
					{
		                return false;
					}
				},
				error: function(){alert("服务器没有返回数据，可能服务器忙，请重试");},
				onerror : "用户名不对，请重新输入",
				onwait : "正在对用户名进行合法性校验，请稍候..."
			});
			$("#email").formValidator({onshow:"请输入邮箱",onfocus:"邮箱6-100个字符,输入正确了才能离开焦点",oncorrect:"恭喜你,你输对了",defaultvalue:"@",forcevalid:false}).inputValidator({min:6,max:100,onerror:"你输入的邮箱长度非法,请确认"}).regexValidator({regexp:"^([\\w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([\\w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$",onerror:"你输入的邮箱格式不正确"})
			.ajaxValidator({
			    type : "get",
				url : "name.php?type=email",
				datatype : "json",
				success : function(data){	
		            if( data == "1" )
					{
		                return true;
					}
		            else
					{
		                return false;
					}
				},
				error: function(){alert("服务器没有返回数据，可能服务器忙，请重试");},
				onerror : "该邮箱已被注册",
				onwait : "正在对用户名进行合法性校验，请稍候..."
			});

		}
	)


</script>

<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td>
    <td valign="top" background="images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt">添加管理员</div></td>
      </tr>
    </table></td>
    <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  
  <tr>
    <td valign="middle" background="images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9">
    <form name="myForm" id="myForm" enctype="multipart/form-data" action="admin_add.php?act=<{if $id==""}>add<{else}>edit<{/if}>" method="post" ><input type="hidden" value="<{$id}>" name="id">
     <table width="100%" border="0" cellspacing="0" cellpadding="0" >
	 <br>	
     <tr  class="nowtable">
     <td class="left_bt2" style="padding-left:10px;">添加管理员</td>
     </tr>	
  <tr>
     <td width="32%" height="40px" bgcolor="#f2f2f2" class="left_txt" style="padding-left:20px;" align="left">
    管理员用户名：<span style="padding-left:28px;"><input name="name" id="name" type="text" /><div id="nameTip" style="width:250px"></div></span>
     </td>
     </tr>
    <tr>
     <td width="32%" height="40px" bgcolor="#f2f2f2" class="left_txt" style="padding-left:30px;" align="left">
    管理员邮箱：<span style="padding-left:30px;"><input id="email" name="email" type="text" class="inp" /><div id="emailTip" style="width:250px"></div></span>
     </td>
     </tr>
       <tr>
     <td width="32%" height="40px" bgcolor="#f2f2f2" class="left_txt" style="padding-left:30px;" align="left">
    管理员密码：<span style="padding-left:30px;"><input type="password" name="pwd1"/></span>
     </td>
     </tr>
     <tr>
     <td width="32%" height="40px" bgcolor="#f2f2f2" class="left_txt" style="padding-left:40px;" align="left">
    管理员组：<span style="padding-left:32px;"><select name="group"><{if $id==""}><{foreach item=loop from=$group}><option value="<{$loop.id}>"><{$loop.group_name}></option><{/foreach}><{else}><{$str}><{/if}></select></span>
     </td>
     </tr>
  

     <tr><td align="left" height="50px"  style="padding-left:200px"><input type="submit" name="submit" value="提交"></td></tr>
     </table>
  </form>
    </td>
    <td background="images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="bottom" background="images/mail_leftbg.gif"><img src="images/buttom_left2.gif" width="17" height="17" /></td>
    <td background="images/buttom_bgs.gif"><img src="images/buttom_bgs.gif" width="17" height="17"></td>
    <td valign="bottom" background="images/mail_rightbg.gif"><img src="images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>
</body>
